﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
DateTime[] joinDates = new DateTime[]
       {
            new DateTime(2020, 9, 1),
            new DateTime(2013, 12, 1),
            new DateTime(2014, 6, 1),
            new DateTime(2016, 12, 1),
            new DateTime(2024, 7, 1),
            new DateTime(2018, 10, 1),
            new DateTime(2023, 8, 1)
       };

DateTime currentDate = DateTime.Now;
double totalDays = 0;

foreach (var joinDate in joinDates)
{
    totalDays += (currentDate - joinDate).TotalDays;
}

double averageDays = totalDays / joinDates.Length;
double averageYears = averageDays / 365;

Console.WriteLine($"平均司龄: {averageYears:F2} 年");
